<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    
    <h:head>
        <title>Facelet Title</title>
        <style> 
        .form
        {
            border-style: solid;
            border-color: silver;
            padding: 50px;
            
            
        }
        
        
        </style>
    </h:head>
    <h:body>
        <ui:composition template="../../admin/adminTemplate.xhtml">
            
            <ui:define name="title">
                Admin Schema
            </ui:define>
            <ui:define name="page">
                
        <h:form class ="form">
            
            <h:messages style="color:red;margin:8px;" />
            
            <p>Redigerar rätt: <h:outputText value="#{listDinner.selectedValue}"/> </p> <!-- output dinner-->
                
            Namn på rätt: <h:inputText value="#{listDinner.dinnerName}"></h:inputText>
            Beskrivning: <h:inputText value="#{listDinner.dinnerDescription}"></h:inputText>
            Pris: <h:inputText value="#{listDinner.dinnerPrice}"></h:inputText>
            
            
            Middags typ: <h:selectOneMenu id = "dinnerType" value="#{listDinner.dinnerType}" >
                        
                    <f:selectItem itemLabel="välj" itemValue=""/>
                    <f:selectItem itemValue="dessert" itemLabel="Efterrätt" />
                    <f:selectItem itemValue="Main Course" itemLabel="Varmrätt" />
                    <f:selectItem itemValue="apetizer" itemLabel="Förrätt" />
    
                     </h:selectOneMenu>
           <h:commandButton value ="spara" action = "#{listDinner.upDate(listDinner.selectedValue)}"></h:commandButton>
           <h:commandButton value ="Hem" action = "/index"></h:commandButton>
            <br/>
            <br/>
            Speciella ingredienser: <br/>
            <h:selectManyListbox value="#{listDinner.selectedIngredients}" >
               <f:selectItems value="#{listDinner.listspec.dinnerIngredients}" var="f"  itemValue="#{f.item_id}" itemLabel="#{f.item_name}"/> 
              
            </h:selectManyListbox>
            </h:form>
            </ui:define>
           
        
        </ui:composition>
    </h:body>
</html>

